import Mock from 'mockjs'

//提前生成数据
var data = Mock.mock({
    "list|66": [
        {
            "id|+1": 1,
            "pic": '@image(375x200,@color)',
            "title": "@ctitle"
        }
    ]
})
//定义接口
Mock.mock('/carousel', 'post', function (ops) {
    var { count } = JSON.parse(ops.body);
    var tempdata = data.list.slice(0, count)
    return {
        "list": tempdata
    }
})
